import { createRouter, createWebHistory } from 'vue-router'
const Login = () => import('../views/Login.vue')
const home=()=>import("../views/home.vue")
const Home = () => import('../views/first.vue')
const table=()=>import("../views/visitAdmin/table.vue")
const verification=()=>import("../views/visitAdmin/example.vue")
const tinymce=()=>import("../views/visitAdmin/tinymc.vue")
const excel=()=>import("../views/visitAdmin/excel.vue")
const journal=()=>import("../views/visitAdmin/journal.vue")
const trajectory=()=>import("../views/trajectory/trahectirylist.vue")
const trahectirylistadd=()=>import("../views/trajectory/trahectirylistadd.vue")
const address=()=>import("../views/trajectory/address.vue")
const addressadd=()=>import("../views/trajectory/addressadd.vue")
const addressupdata=()=>import("../views/trajectory/addressupdata.vue")
const role=()=>import("../views/admin/role.vue")
const adminlist=()=>import("../views/admin/list.vue")
const settings=()=>import("../views/setting/setting.vue")
const charts=()=>import("../views/setting/charts.vue")
const line=()=>import("../views/setting/changeadd.vue")
const emitline=()=>import("../views/setting/chengeemitadd.vue")
// trahectirylistadd




const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path:"/home",
      name:"Home",
      component:Home,
      meta: {
        title: '首页', icon: 'homepage',
        requireAuth: true,
      },
      children:[
        {
          path:"/home",
          name:"home",
          component:home,
          meta: { title: '首页', icon: 'home' }
        },
        {
          path:"/table/drag-table",
          name:"table",
          component:table,
          meta: { parent: "访客管理", title: '访客管理', icon: 'homepage' }
        },
        {
          path:"/example/list",
          name:"example",
          component:verification,
          meta: { parent: "访客管理", title: '核销人员', icon: 'homepage' }
        },
        {
          path:"/components-demo/tinymce",
          name:"tinymce",
          component:tinymce,
          meta: { parent: "访客管理", title: '校园动态管理', icon: 'homepage' }
        },
        {
          path:"/excel/export-excel",
          name:"excel",
          component:excel,
          meta: { parent: "访客管理", title: '审核日志', icon: 'homepage' }
        },
        {
          path:"/example/journal",
          name:"journal",
          component:journal,
          meta: { parent: "访客管理", title: '销核日志', icon: 'homepage' }
        },
        {
          path:"/trajectory/trajectorylist",
          name:"trajectory",
          component:trajectory,
          meta: { parent: "行程管理", title: '轨迹管理', icon: 'homepage' }
        },
        {
          path:"/trajectory/trahectirylistadd",
          name:"trahectirylistadd",
          component:trahectirylistadd,
          meta: { parent: "行程管理", title: '轨迹管理', icon: 'homepage' }
        },
        {
          path:"/address/addresslist",
          name:"address",
          component:address,
          meta: { parent: "行程管理", title: '点位管理', icon: 'homepage' }
        },
        {
          path:"/address/addressadd",
          name:"addressadd",
          component:addressadd,
          meta: { parent: "行程管理", title: '点位管理', icon: 'homepage' }
        },
        {
          path:"/address/addressupdata",
          name:"addressupdata",
          component:addressupdata,
          meta: { parent: "行程管理", title: '点位管理', icon: 'homepage', }
        },
        {
          path:"/role/role-list",
          name:"role",
          component:role,
          meta: { parent: "权限管理", title: '角色管理', icon: 'homepage', keepAlive:true}
        },
        {
          path:"/admin/list",
          name:"adminlist",
          component:adminlist,
          meta: { parent: "权限管理", title: '管理员管理', icon: 'homepage',keepAlive:true }
        },
        {
          path:"/settings/settings",
          name:"settings",
          component:settings,
          meta: { parent: "设置", title: '系统管理', icon: 'homepage' }
        },
        {
          path:"/charts/keyboard",
          name:"charts",
          component:charts,
          meta: { parent: "设置", title: '部门管理', icon: 'homepage' }
        },
        {
          path:"/charts/line",
          name:"line",
          props:true,
          component:line,
        },
        {
          path:"/charts/emitline",
          name:"emitline",
          props:true,
          component:emitline,
        },
        {
          path: '/auddetails',
          name: 'auddetails',
          meta: {
            keepAlive: false
          },
          component: () => import('../views/visitAdmin/details/auddetails.vue')
        },
        {
          path: '/condetails',
          name: 'condetails',
          meta: {
            keepAlive: false
          },
          component: () => import('../views/admin/details/condetails.vue')
        },
        {
          path: '/conupdata',
          name: 'conupdata',
          meta: {
            keepAlive: false
          },
          component: () => import('../views/admin/updata/conupdata.vue')
        },
        {
          path: '/conadd',
          name: 'conadd',
          meta: {
            keepAlive: false
          },
          component: () => import('../views/admin/add/conadd.vue')
        },
        {
          path: '/roleadd',
          name: 'roleadd',
          meta: {
            keepAlive: false
          },
          component: () => import('../views/admin/add/roleadd.vue')
        },
        {
          path: '/authenadd',
          name: 'authenadd',
          meta: {
            keepAlive: false
          },
          component: () => import('../components/authenadd/authenadd.vue')
        },
        {
          path: '/campusadd',
          name: 'campusadd',
          meta: {
            keepAlive: false
          },
          component: () => import('../components/campusadd/campusadd.vue')
        },
        {
          path: '/visitor-add',
          name: 'visitor-add',
          meta: {
            keepAlive: false
          },
          component: () => import('../components/visitor-add/visitor-add.vue')
        },
        {
          path: '/visitor-particulars',
          name: 'visitor-particulars',
          meta: {
            keepAlive: false
          },
          component: () => import('../components/visitor-particulars/visitor-particulars.vue')
        },
        {
          path: '/onelist',
          name: 'onelist',
          meta: {
            keepAlive: false
          },
          component: () => import('../components/onelist/onelist.vue')
        },
      ]
    }
  ]
})

export default router
